package com.alinesno.cloud.base.logger.thymeleaf;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import com.alinesno.cloud.base.logger.entity.LogSettingsEntity;
import com.alinesno.cloud.base.logger.service.ILogSettingsService;
import com.alinesno.cloud.common.facade.enums.HasStatusEnums;
import com.alinesno.cloud.common.facade.wrapper.RestWrapper;

/**
 * 页面服务(供页面调用)
 */
@Component("watcherPageHandle")
public class WatcherThymeleafPageService {

	@Autowired
	private ILogSettingsService logSettingService ; 

	/**
	 * 获取设置分组
	 * @param group
	 * @return
	 */
	public List<LogSettingsEntity> settings(String group){
		Assert.hasLength(group , "分组不能为空.");
		return logSettingService.findAll(RestWrapper.create().eq("keyCode", group).eq("hasStatus", HasStatusEnums.LEGAL.value)) ; 
	}
	
}